<?php
//订单
Route::group([
    'namespace' => 'App\Http\Controllers\StoreCenter',
    'prefix' => 'product/order',
    'middleware' => ['response'],
], function () {
    Route::post('/add', "OrderController@addOrder")->middleware('transaction');
    Route::delete('/del', "OrderController@delOrder");
    Route::put('/edit', "OrderController@editOrder")->middleware('transaction');
    Route::get('/list', "OrderController@getOrderList");
    Route::get('/info', "OrderController@getOrderInfo");
});


//购物车
Route::group([
    'namespace' => 'App\Http\Controllers\StoreCenter',
    'prefix' => 'product/cart',
    'middleware' => ['response', 'auth'],
], function () {
    Route::post('/add', "CartController@addCart");
    Route::delete('/del', "CartController@delCart");
//    Route::put('/edit', "CartController@editCart");
    Route::get('/list', "CartController@getCartList");
    Route::get('/info', "CartController@getCartInfo");
});

//购物车
Route::group([
    'namespace' => 'App\Http\Controllers\Product',
    'prefix' => 'v1/product',
    'middleware' => ['response'],
], function () {
    Route::get('/list', "SpuController@getProductListV1");
    Route::get('/info', "SpuController@getProductInfoV1");
});

//优惠券
Route::group([
    'namespace' => 'App\Http\Controllers\StoreCenter',
    'prefix' => 'store/coupon',
    'middleware' => ['response', 'auth'],
], function () {
    Route::post('/add', "CouponController@addCoupon");
    Route::delete('/del', "CouponController@delCoupon");
    Route::put('/edit', "CouponController@editCoupon");
    Route::get('/list', "CouponController@getCouponList");
    Route::get('/info', "CouponController@getCouponInfo");
});
